package com.kele.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

//等价于 <bean id="user" class="com.kele.pojo.User"/>
//@Component 意为组件
@Component
//singleton 单例模式  prototype 原型模式
@Scope("singleton")
public class User {

    public String name;

    //相当于<property name="name" value="daishou"/>
    @Value("daishou2")
    public void setName(String name) {
        this.name = name;
    }
}
